<html>
<head><meta charset="utf-8"><title>macOS cross-compile from x86_64 · t-compiler/arm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/index.html">t-compiler/arm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html">macOS cross-compile from x86_64</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202718536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202718536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202718536">(Jul 02 2020 at 17:23)</a>:</h4>
<p>So I'm attempting to cross-compile completely from x86_64. Since I don't have a DTK, it's ultimately a futile exercise, but I might be able to provide a bit more help this way.</p>
<p>Right now, I'm at</p>
<div class="codehilite"><pre><span></span><code>          ld: in /var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/rustc14s8RF/libbacktrace_sys-f872603a267847cb.rlib(alloc.o), archive member &#39;alloc.o&#39; with length 1968 is not mach-o or llvm bitcode file &#39;/var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/rustc14s8RF/libbacktrace_sys-f872603a267847cb.rlib&#39; for architecture arm64
</code></pre></div>


<p>Extracting alloc.o shows that it is indeed for x86_64. I'm guessing libbacktrace compiles some C code with the wrong settings</p>



<a name="202719576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202719576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202719576">(Jul 02 2020 at 17:30)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[backtrace-sys 0.1.37] running: &quot;cc&quot; &quot;-O3&quot; &quot;-ffunction-sections&quot; &quot;-fdata-sections&quot; &quot;-fPIC&quot; &quot;-I&quot; &quot;src/libbacktrace&quot; &quot;-I&quot; &quot;/Users/shep/Projects/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/build/backtrace-sys-5f53ac621a65f3a3/out&quot; &quot;-fvisibility=hidden&quot; &quot;-DHAVE_MACH_O_DYLD_H=1&quot; &quot;-DBACKTRACE_SUPPORTED=1&quot; &quot;-DBACKTRACE_USES_MALLOC=1&quot; &quot;-DBACKTRACE_SUPPORTS_THREADS=0&quot; &quot;-DBACKTRACE_SUPPORTS_DATA=0&quot; &quot;-DHAVE_DL_ITERATE_PHDR=1&quot; &quot;-D_GNU_SOURCE=1&quot; &quot;-D_LARGE_FILES=1&quot; &quot;-Dbacktrace_full=__rdos_backtrace_full&quot; &quot;-Dbacktrace_dwarf_add=__rdos_backtrace_dwarf_add&quot; &quot;-Dbacktrace_initialize=__rdos_backtrace_initialize&quot; &quot;-Dbacktrace_pcinfo=__rdos_backtrace_pcinfo&quot; &quot;-Dbacktrace_syminfo=__rdos_backtrace_syminfo&quot; &quot;-Dbacktrace_get_view=__rdos_backtrace_get_view&quot; &quot;-Dbacktrace_release_view=__rdos_backtrace_release_view&quot; &quot;-Dbacktrace_alloc=__rdos_backtrace_alloc&quot; &quot;-Dbacktrace_free=__rdos_backtrace_free&quot; &quot;-Dbacktrace_vector_finish=__rdos_backtrace_vector_finish&quot; &quot;-Dbacktrace_vector_grow=__rdos_backtrace_vector_grow&quot; &quot;-Dbacktrace_vector_release=__rdos_backtrace_vector_release&quot; &quot;-Dbacktrace_close=__rdos_backtrace_close&quot; &quot;-Dbacktrace_open=__rdos_backtrace_open&quot; &quot;-Dbacktrace_print=__rdos_backtrace_print&quot; &quot;-Dbacktrace_simple=__rdos_backtrace_simple&quot; &quot;-Dbacktrace_qsort=__rdos_backtrace_qsort&quot; &quot;-Dbacktrace_create_state=__rdos_backtrace_create_state&quot; &quot;-Dbacktrace_uncompress_zdebug=__rdos_backtrace_uncompress_zdebug&quot; &quot;-Dmacho_get_view=__rdos_macho_get_view&quot; &quot;-Dmacho_symbol_type_relevant=__rdos_macho_symbol_type_relevant&quot; &quot;-Dmacho_get_commands=__rdos_macho_get_commands&quot; &quot;-Dmacho_try_dsym=__rdos_macho_try_dsym&quot; &quot;-Dmacho_try_dwarf=__rdos_macho_try_dwarf&quot; &quot;-Dmacho_get_addr_range=__rdos_macho_get_addr_range&quot; &quot;-Dmacho_get_uuid=__rdos_macho_get_uuid&quot; &quot;-Dmacho_add=__rdos_macho_add&quot; &quot;-Dmacho_add_symtab=__rdos_macho_add_symtab&quot; &quot;-Dmacho_file_to_host_u64=__rdos_macho_file_to_host_u64&quot; &quot;-Dmacho_file_to_host_u32=__rdos_macho_file_to_host_u32&quot; &quot;-Dmacho_file_to_host_u16=__rdos_macho_file_to_host_u16&quot; &quot;-o&quot; &quot;/Users/shep/Projects/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/build/backtrace-sys-5f53ac621a65f3a3/out/src/libbacktrace/sort.o&quot; &quot;-c&quot; &quot;src/libbacktrace/sort.c&quot;
[backtrace-sys 0.1.37] exit code: 0
</code></pre></div>



<a name="202720024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202720024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202720024">(Jul 02 2020 at 17:34)</a>:</h4>
<p>Does <code>cargo</code> get <code>--target</code> as argument?</p>



<a name="202720454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202720454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202720454">(Jul 02 2020 at 17:37)</a>:</h4>
<p>I broke my build directory, lemme clean and then paste what I think will answer</p>



<a name="202720910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202720910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202720910">(Jul 02 2020 at 17:40)</a>:</h4>
<p>ugh. I should do <code>x.py clean</code> instead of <code>rm -r build</code></p>



<a name="202721533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202721533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202721533">(Jul 02 2020 at 17:45)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[backtrace-sys 0.1.37] TARGET = Some(&quot;aarch64-apple-darwin&quot;)
[backtrace-sys 0.1.37] OPT_LEVEL = Some(&quot;3&quot;)
[backtrace-sys 0.1.37] HOST = Some(&quot;x86_64-apple-darwin&quot;)
[backtrace-sys 0.1.37] CC_aarch64-apple-darwin = None
[backtrace-sys 0.1.37] CC_aarch64_apple_darwin = None
[backtrace-sys 0.1.37] TARGET_CC = None
[backtrace-sys 0.1.37] CC = None
[backtrace-sys 0.1.37] CROSS_COMPILE = None
[backtrace-sys 0.1.37] CFLAGS_aarch64-apple-darwin = None
[backtrace-sys 0.1.37] CFLAGS_aarch64_apple_darwin = None
[backtrace-sys 0.1.37] TARGET_CFLAGS = None
[backtrace-sys 0.1.37] CFLAGS = None
[backtrace-sys 0.1.37] CRATE_CC_NO_DEFAULTS = None
[backtrace-sys 0.1.37] DEBUG = Some(&quot;false&quot;)
[backtrace-sys 0.1.37] CARGO_CFG_TARGET_FEATURE = Some(&quot;fp,neon&quot;)
</code></pre></div>



<a name="202721822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202721822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202721822">(Jul 02 2020 at 17:47)</a>:</h4>
<p>So I'm trying to set <code>CFLAGS_aarch64_apple_darwin</code> this time</p>



<a name="202721930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202721930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202721930">(Jul 02 2020 at 17:48)</a>:</h4>
<p>I do get a bunch of </p>
<div class="codehilite"><pre><span></span><code>&#39;aarch64&#39; is not a recognized processor for this target (ignoring processor)
&#39;+cyclone&#39; is not a recognized feature for this target (ignoring feature)
</code></pre></div>


<p>which makes it seem like I've got something important missing</p>



<a name="202722076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202722076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202722076">(Jul 02 2020 at 17:49)</a>:</h4>
<p>Apple probably calls it <code>arm64</code>, not <code>aarch64</code>.</p>



<a name="202722293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202722293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202722293">(Jul 02 2020 at 17:51)</a>:</h4>
<p>They call it a great number of things, sadly (see <a class="stream-topic" data-stream-id="242906" href="/#narrow/stream/242906-t-compiler.2Farm/topic/macOS.20target.20name">#t-compiler/arm &gt; macOS target name</a> )</p>



<a name="202722541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202722541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202722541">(Jul 02 2020 at 17:52)</a>:</h4>
<p>Alright, progress... many of these:</p>
<div class="codehilite"><pre><span></span><code>          ld: warning: cannot export hidden symbol compiler_builtins::int::mul::__muldi3::hc055e41c117f2fd8 from /var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/rustctnqHbQ/libcompiler_builtins-ed0e6039e239b415.rlib(compiler_builtins-ed0e6039e239b415.compiler_builtins.58d6zphi-cgu.65.rcgu.o)
</code></pre></div>


<p>and some missing symbols</p>
<div class="codehilite"><pre><span></span><code>          Undefined symbols for architecture arm64:
            &quot;_fstat$INODE64&quot;, referenced from:
                std::sys::unix::fs::copy::h94fa72224844b73a in std-ac98f610a57655a2.std.cyil4mrz-cgu.12.rcgu.o
                std::fs::read::inner::hd91bb2b187e3afe9 in std-ac98f610a57655a2.std.cyil4mrz-cgu.7.rcgu.o
                std::fs::read_to_string::inner::h73d2852d02c10092 in std-ac98f610a57655a2.std.cyil4mrz-cgu.7.rcgu.o
                std::fs::File::metadata::h3795d6b472a9819d in std-ac98f610a57655a2.std.cyil4mrz-cgu.7.rcgu.o
            &quot;_lstat$INODE64&quot;, referenced from:
                std::sys::unix::fs::lstat::h865b8890e460bb6b in std-ac98f610a57655a2.std.cyil4mrz-cgu.12.rcgu.o
            &quot;_stat$INODE64&quot;, referenced from:
                std::sys::unix::fs::stat::h399662f904f235cd in std-ac98f610a57655a2.std.cyil4mrz-cgu.12.rcgu.o
            &quot;_readdir_r$INODE64&quot;, referenced from:
                _$LT$std..sys..unix..fs..ReadDir$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hd68ac377f94a34ca in std-ac98f610a57655a2.std.cyil4mrz-cgu.12.rcgu.o
</code></pre></div>



<a name="202722590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202722590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202722590">(Jul 02 2020 at 17:53)</a>:</h4>
<p>I bet those are issues in libc</p>



<a name="202722638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202722638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202722638">(Jul 02 2020 at 17:53)</a>:</h4>
<p>My current compilation command:</p>
<div class="codehilite"><pre><span></span><code>CFLAGS_aarch64_apple_darwin=&#39;-arch arm64 -isysroot /Users/shep/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -Wl,-syslibroot /Users/shep/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk &#39; RUST_BACKTRACE=1 ../x.py build --stage 1 --host $PWD/aarch64-apple-darwin.json src/libstd --jobs 1 -vvvvv
</code></pre></div>



<a name="202738992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202738992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202738992">(Jul 02 2020 at 20:05)</a>:</h4>
<p>I’ll provide more details and specifics later, but thanks to <span class="user-mention" data-user-id="116122">@simulacrum</span>’s help, I’ve gotten through to building LLVM. I think that bodes well.</p>



<a name="202742826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202742826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202742826">(Jul 02 2020 at 20:49)</a>:</h4>
<p>awesome! I actually fell back on trying to do this from my laptop last night</p>



<a name="202742896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202742896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202742896">(Jul 02 2020 at 20:50)</a>:</h4>
<p>but didn't get as far as you :)</p>



<a name="202742938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202742938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202742938">(Jul 02 2020 at 20:50)</a>:</h4>
<p>I'd love to try out your changes if you've got them pushed somewhere</p>



<a name="202744624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202744624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202744624">(Jul 02 2020 at 21:06)</a>:</h4>
<p>I just realized that this is my avr branch as well, and I'm in the middle of a build. So you get the dump of things that shouldn't event be there too. you probably want to rebase this on master and drop the avr commits out.</p>
<ul>
<li><a href="https://github.com/shepmaster/rust/tree/silicon">https://github.com/shepmaster/rust/tree/silicon</a></li>
<li><a href="https://github.com/shepmaster/libc/tree/silicon">https://github.com/shepmaster/libc/tree/silicon</a></li>
</ul>



<a name="202747259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202747259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202747259">(Jul 02 2020 at 21:35)</a>:</h4>
<p>Also, it makes sense in retrospect, but compiling LLVM twice is a bummer.</p>



<a name="202754674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202754674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202754674">(Jul 02 2020 at 23:17)</a>:</h4>
<div class="codehilite"><pre><span></span><code>          ld: in /var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/rustcNo8q2s/librustc_llvm-c1cd104774b8229a.rlib(PassWrapper.o), archive member &#39;PassWrapper.o&#39; with length 169568 is not mach-o or llvm bitcode file &#39;/var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/rustcNo8q2s/librustc_llvm-c1cd104774b8229a.rlib&#39; for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: could not compile `rustc_driver`.
</code></pre></div>



<a name="202754821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202754821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202754821">(Jul 02 2020 at 23:19)</a>:</h4>
<p>hmm</p>
<div class="codehilite"><pre><span></span><code>    &gt; Llvm { target: &quot;/Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json&quot; }
Building LLVM for /Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json
      &gt; Llvm { target: &quot;x86_64-apple-darwin&quot; }
</code></pre></div>



<a name="202756692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202756692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202756692">(Jul 02 2020 at 23:53)</a>:</h4>
<p>that seems... odd</p>



<a name="202765917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202765917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202765917">(Jul 03 2020 at 03:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/242906-t-compiler.2Farm/topic/macOS.20cross-compile.20from.20x86_64/near/202722590">said</a>:</p>
<blockquote>
<p>I bet those are issues in libc</p>
</blockquote>
<p>Yeah, libc shouldn't be using the <code>$INODE64</code> suffix, which is an ABI backwards compatibility hack for targets that used to have 32-bit <code>ino_t</code>, and isn't used on targets that have always had 64-bit <code>ino_t</code>.</p>



<a name="202766075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202766075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202766075">(Jul 03 2020 at 03:40)</a>:</h4>
<p>libc needs to change the condition in things like <code>#[cfg_attr(target_os = "macos", link_name = "statfs$INODE64")]</code></p>



<a name="202791115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202791115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202791115">(Jul 03 2020 at 10:55)</a>:</h4>
<blockquote>
<p>libc needs to change the condition in things like</p>
</blockquote>
<p>Already done. See the link above to my libc fork.</p>



<a name="202793684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202793684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202793684">(Jul 03 2020 at 11:28)</a>:</h4>
<p>Getting close!</p>
<div class="codehilite"><pre><span></span><code>          Undefined symbols for architecture arm64:
            &quot;_crc32&quot;, referenced from:
                llvm::JamCRC::update(llvm::ArrayRef&lt;unsigned char&gt;) in librustc_llvm-c1cd104774b8229a.rlib(CRC.cpp.o)
            &quot;_uncompress&quot;, referenced from:
                llvm::zlib::uncompress(llvm::StringRef, char*, unsigned long&amp;) in librustc_llvm-c1cd104774b8229a.rlib(Compression.cpp.o)
            &quot;_compressBound&quot;, referenced from:
                llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl&lt;char&gt;&amp;, int) in librustc_llvm-c1cd104774b8229a.rlib(Compression.cpp.o)
            &quot;_compress2&quot;, referenced from:
                llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl&lt;char&gt;&amp;, int) in librustc_llvm-c1cd104774b8229a.rlib(Compression.cpp.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: could not compile `rustc_driver`.
</code></pre></div>



<a name="202794164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202794164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202794164">(Jul 03 2020 at 11:34)</a>:</h4>
<p>How can I figure out what is supposed to provide those symbols... Are we supposed to bring our own zlib, is LLVM compiling one...</p>



<a name="202796444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202796444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202796444">(Jul 03 2020 at 12:04)</a>:</h4>
<p>I just hacked it to always add <code>-lz</code> to every linker invocation. What could go wrong</p>



<a name="202796454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202796454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202796454">(Jul 03 2020 at 12:04)</a>:</h4>
<div class="codehilite"><pre><span></span><code>% file  aarch64-apple-darwin/stage1/bin/rustc
aarch64-apple-darwin/stage1/bin/rustc: Mach-O 64-bit executable arm64
</code></pre></div>



<a name="202796458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202796458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202796458">(Jul 03 2020 at 12:04)</a>:</h4>
<p>hmmmmmmm</p>



<a name="202797182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202797182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202797182">(Jul 03 2020 at 12:13)</a>:</h4>
<p>I've sent <span class="user-mention" data-user-id="317220">@André Arko</span> a 75MB zip of my stage1 compiler that claims to be native. We'll see what happens <span aria-label="fingers crossed" class="emoji emoji-1f91e" role="img" title="fingers crossed">:fingers_crossed:</span></p>



<a name="202831064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831064">(Jul 03 2020 at 19:22)</a>:</h4>
<p>sadly it seems to hang forever <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="202831120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831120">(Jul 03 2020 at 19:22)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ~/stage1/bin/rustc -Z unstable-options --print target-spec-json
^C
❯ ./stage1/bin/rustc hello.rs
</code></pre></div>



<a name="202831145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831145">(Jul 03 2020 at 19:23)</a>:</h4>
<p>Could you get a backtrace where it hangs?</p>



<a name="202831300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831300">(Jul 03 2020 at 19:26)</a>:</h4>
<p>!! nevermind it's the macOS quarantine system</p>



<a name="202831437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831437">(Jul 03 2020 at 19:28)</a>:</h4>
<p>had to recursively un-quarantine all the files</p>



<a name="202831452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831452">(Jul 03 2020 at 19:28)</a>:</h4>
<p>time to go check out jake's fork of rust, I think:</p>



<a name="202831455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831455">(Jul 03 2020 at 19:28)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ./stage1/bin/rustc hello.rs
error: Error loading target specification: Could not find specification for target &quot;/Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json&quot;. Use `--print target-list` for a list of built-in targets
</code></pre></div>



<a name="202831481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831481">(Jul 03 2020 at 19:29)</a>:</h4>
<p>what does <code>rustc --version --verbose</code> say?</p>



<a name="202831490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831490">(Jul 03 2020 at 19:29)</a>:</h4>
<p>And <code>rustc --print target-list</code> to see the supported targets.</p>



<a name="202831492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831492">(Jul 03 2020 at 19:29)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ./stage1/bin/rustc -vV
rustc 1.46.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: /Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json
release: 1.46.0-dev
LLVM version: 10.0
</code></pre></div>



<a name="202831505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831505">(Jul 03 2020 at 19:30)</a>:</h4>
<p>heh<br>
You can download <a href="https://raw.githubusercontent.com/shepmaster/rust/silicon/silicon/aarch64-apple-darwin.json">https://raw.githubusercontent.com/shepmaster/rust/silicon/silicon/aarch64-apple-darwin.json</a></p>



<a name="202831570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831570">(Jul 03 2020 at 19:30)</a>:</h4>
<p>I didn't want to keep rebuilding a stage0 compiler to change the target</p>



<a name="202831587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831587">(Jul 03 2020 at 19:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> Did you also add a target to <code>src/librustc_target</code>?</p>



<a name="202831593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831593">(Jul 03 2020 at 19:31)</a>:</h4>
<p>yeah totally <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="202831607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831607">(Jul 03 2020 at 19:31)</a>:</h4>
<p>I added none. I actually built that stage1 completely from a stock nightly</p>



<a name="202831621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831621">(Jul 03 2020 at 19:31)</a>:</h4>
<p>"stock"</p>



<a name="202831674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831674">(Jul 03 2020 at 19:32)</a>:</h4>
<p>it seems like that target is now hardcoded, maybe I'm going to have to create the full path?</p>



<a name="202831677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831677">(Jul 03 2020 at 19:32)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ./stage1/bin/rustc --target ./aarch64-apple-darwin.json hello.rs
error: Error loading host specification: Could not find specification for target &quot;/Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json&quot;
</code></pre></div>



<a name="202831701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831701">(Jul 03 2020 at 19:32)</a>:</h4>
<p>I'd think you could do <code>rustc --target thatfile.json hello.rs</code></p>



<a name="202831715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831715">(Jul 03 2020 at 19:32)</a>:</h4>
<p>oh there it is</p>



<a name="202831720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831720">(Jul 03 2020 at 19:32)</a>:</h4>
<p>that's what I did, check the command :)</p>



<a name="202831757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831757">(Jul 03 2020 at 19:33)</a>:</h4>
<blockquote>
<p><code>./x.py build --stage 1 --host $PWD/aarch64-apple-darwin.json</code></p>
</blockquote>
<p>oh :D</p>



<a name="202831760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831760">(Jul 03 2020 at 19:33)</a>:</h4>
<p>Well that's annoying</p>



<a name="202831778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831778">(Jul 03 2020 at 19:33)</a>:</h4>
<p>oh weird, even that doesn't work</p>



<a name="202831781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831781">(Jul 03 2020 at 19:33)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ cat /Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json | head -n2
{
  &quot;-- comment --&quot;: &quot;needed?&quot;,
❯ ./stage1/bin/rustc --target ./aarch64-apple-darwin.json hello.rs
error: Error loading host specification: Could not find specification for target &quot;/Users/shep/Projects/rust/silicon/aarch64-apple-darwin.json&quot;
</code></pre></div>



<a name="202831793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831793">(Jul 03 2020 at 19:33)</a>:</h4>
<p>ohhhhh oh no</p>



<a name="202831835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831835">(Jul 03 2020 at 19:34)</a>:</h4>
<p>it's looking for a _target with that name_</p>



<a name="202831841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831841">(Jul 03 2020 at 19:34)</a>:</h4>
<p>not the file at that path</p>



<a name="202831916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831916">(Jul 03 2020 at 19:35)</a>:</h4>
<p>The error is at <a href="https://github.com/rust-lang/rust/blob/f844ea1e561475e6023282ef167e76bc973773ef/src/librustc_session/session.rs#L1123">https://github.com/rust-lang/rust/blob/f844ea1e561475e6023282ef167e76bc973773ef/src/librustc_session/session.rs#L1123</a></p>



<a name="202831942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202831942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202831942">(Jul 03 2020 at 19:35)</a>:</h4>
<p>yeah, rustc likes to be a bit cavalier about mixing targets and files. My 300 line patch to bootstrap is one example of that.</p>



<a name="202832026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832026">(Jul 03 2020 at 19:36)</a>:</h4>
<p><code>Target::search</code> is at <a href="https://github.com/rust-lang/rust/blob/f844ea1e561475e6023282ef167e76bc973773ef/src/librustc_target/spec/mod.rs#L1508">https://github.com/rust-lang/rust/blob/f844ea1e561475e6023282ef167e76bc973773ef/src/librustc_target/spec/mod.rs#L1508</a></p>



<a name="202832036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832036">(Jul 03 2020 at 19:36)</a>:</h4>
<p>Any reason you're not starting with a cross-compiler? The system can even emulate x86, right?</p>



<a name="202832086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832086">(Jul 03 2020 at 19:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> I'm happy to try reproducing your build directly on the DTK, if you have steps... I'm currently adding shepmaster remotes to all the submodules and hoping the right commits will appear <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="202832093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832093">(Jul 03 2020 at 19:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/242906-t-compiler.2Farm/topic/macOS.20cross-compile.20from.20x86_64/near/202832036">said</a>:</p>
<blockquote>
<p>Any reason you're not starting with a cross-compiler?</p>
</blockquote>
<p>I think you'll need to be more specific. I _did_ cross compile rustc from x86_64 to aarch.</p>



<a name="202832152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832152">(Jul 03 2020 at 19:38)</a>:</h4>
<div class="codehilite"><pre><span></span><code>$ python x.py clean                                                                                               ✔  1.46.0-nightly R  andre@Mac
Updating only changed submodules
Updating submodule src/llvm-project
fatal: remote error: upload-pack: not our ref c3a2e430dffd05bfcc0b07621e95427d57156fb3
Fetched in submodule path &#39;src/llvm-project&#39;, but it did not contain c3a2e430dffd05bfcc0b07621e95427d57156fb3. Direct fetching of that commit failed.
</code></pre></div>



<a name="202832163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832163">(Jul 03 2020 at 19:38)</a>:</h4>
<p>I'm not seeing a public shepmaster/llvm-project, is that commit hiding out somewhere else?</p>



<a name="202832171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832171">(Jul 03 2020 at 19:39)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> The problem here is that the bootstrap compiler doesn't know about the target, so it needs a json target spec. The resulting compiler however interprets the full target spec path as the name of a builtin triple for the host.</p>



<a name="202832177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832177">(Jul 03 2020 at 19:39)</a>:</h4>
<p>oh it's shepmaster/llvm</p>



<a name="202832187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832187">(Jul 03 2020 at 19:39)</a>:</h4>
<p><span class="user-mention" data-user-id="317220">@André Arko</span> it should be:</p>
<ol>
<li>pull shepmaster/rust on the <code>silicon</code> branch. (see note)</li>
<li>pull shepmaster/libc on the <code>silicon</code> branch. Move it to <code>$RUSTDIR/silicon/libc</code></li>
</ol>



<a name="202832204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832204">(Jul 03 2020 at 19:39)</a>:</h4>
<p>You will need to rebase my branch and remove all the AVR commits (started working without looking)</p>



<a name="202832269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832269">(Jul 03 2020 at 19:40)</a>:</h4>
<p>You can drop off all the commits including and before</p>
<div class="codehilite"><pre><span></span><code>commit 0d8d647b04238a9e7b21bd2c0244692f3c72900c
Author: Jake Goulding &lt;jake.goulding@gmail.com&gt;
Date:   2020-06-25 20:36:29 -0400

    reloc cherry
</code></pre></div>



<a name="202832305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832305">(Jul 03 2020 at 19:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> What if you change <a href="https://github.com/rust-lang/rust/blob/f844ea1e561475e6023282ef167e76bc973773ef/src/librustc_session/session.rs#L1121">https://github.com/rust-lang/rust/blob/f844ea1e561475e6023282ef167e76bc973773ef/src/librustc_session/session.rs#L1121</a> to use <code>from_path</code>? The compiled compiler should then look for a file instead of builtin triple for the host target.</p>



<a name="202832340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832340">(Jul 03 2020 at 19:41)</a>:</h4>
<p>My specific command line invocation is in <code>silicon/build-command</code></p>



<a name="202832346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832346">(Jul 03 2020 at 19:41)</a>:</h4>
<p><code>Failed to merge submodule src/llvm-project (commits not present)</code></p>



<a name="202832420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832420">(Jul 03 2020 at 19:42)</a>:</h4>
<p>And you will want to move my target.json into the code, which you know how to do.</p>



<a name="202832513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832513">(Jul 03 2020 at 19:44)</a>:</h4>
<p>yep, that part makes sense to me</p>



<a name="202832531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832531">(Jul 03 2020 at 19:44)</a>:</h4>
<p>but yes, my LLVM changes don't exist anywhere else; they are a bunch of random cherry-picks from LLVM master for AVR</p>



<a name="202832570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832570">(Jul 03 2020 at 19:45)</a>:</h4>
<p>ahhh okay so the issue was there is one commit after reloc cherry</p>



<a name="202832576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832576">(Jul 03 2020 at 19:45)</a>:</h4>
<p>and when I skip that as well, it's fine</p>



<a name="202832674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832674">(Jul 03 2020 at 19:47)</a>:</h4>
<p>oops :-)</p>



<a name="202832680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832680">(Jul 03 2020 at 19:47)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> WDYT about</p>
<div class="codehilite"><pre><span></span><code>    let host_triple = TargetTriple::from_path(&quot;/tmp/aarch64-apple-darwin.json&quot;).expect(&quot;hard-coded bootstrap host/target not found at /tmp/aarch64-apple-darwin.json&quot;);
</code></pre></div>



<a name="202832754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832754">(Jul 03 2020 at 19:48)</a>:</h4>
<p>then at least my silly path isn't infecting other people</p>



<a name="202832764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832764">(Jul 03 2020 at 19:48)</a>:</h4>
<p>That should work.</p>



<a name="202832944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202832944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202832944">(Jul 03 2020 at 19:51)</a>:</h4>
<p>Rebuilding now. We can race to see who gets there first.</p>



<a name="202833002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202833002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202833002">(Jul 03 2020 at 19:52)</a>:</h4>
<p>I'm just hoping I can claim "first person to cross-compile a Rust program to Apple Silicon".</p>



<a name="202833007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202833007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202833007">(Jul 03 2020 at 19:52)</a>:</h4>
<p><span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="202833445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202833445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202833445">(Jul 03 2020 at 20:00)</a>:</h4>
<p>oh christ I forgot there's no cmake on aarch64 yet</p>



<a name="202834165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202834165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202834165">(Jul 03 2020 at 20:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/242906-t-compiler.2Farm/topic/macOS.20cross-compile.20from.20x86_64/near/202833002">said</a>:</p>
<blockquote>
<p>I'm just hoping I can claim "first person to cross-compile a Rust program to Apple Silicon".</p>
</blockquote>
<p>My guess is that there's someone from Apple that's already done it privately, but I think I get the in-public version.</p>



<a name="202834279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202834279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202834279">(Jul 03 2020 at 20:11)</a>:</h4>
<p>well, the WWDC slide didn't have rust on it, so even if they exist they aren't claiming it</p>



<a name="202834290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202834290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202834290">(Jul 03 2020 at 20:11)</a>:</h4>
<p>but yeah, I think you win even if my compile somehow finishes first</p>



<a name="202834335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202834335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202834335">(Jul 03 2020 at 20:12)</a>:</h4>
<p>(it won't, I haven't even finished copying the DTK xcode onto my intel laptop yet)</p>



<a name="202834382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202834382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202834382">(Jul 03 2020 at 20:13)</a>:</h4>
<p>Well, you already ran my "winning entry" :-)</p>



<a name="202834386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202834386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202834386">(Jul 03 2020 at 20:13)</a>:</h4>
<p>exactly :)</p>



<a name="202838008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202838008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202838008">(Jul 03 2020 at 21:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> progress! this is how far I had managed to get with my own cross-compile and the target def that was probably also wrong :)</p>



<a name="202838009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202838009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202838009">(Jul 03 2020 at 21:31)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ ./stage1/bin/rustc hello.rs --target /tmp/aarch64-apple-darwin.json
&#39;aarch64&#39; is not a recognized processor for this target (ignoring processor)
&#39;+cyclone&#39; is not a recognized feature for this target (ignoring feature)
&#39;aarch64&#39; is not a recognized processor for this target (ignoring processor)
error[E0463]: can&#39;t find crate for `std`
  |
  = note: the `aarch64-apple-darwin-5608017271818730525` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
</code></pre></div>



<a name="202838062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202838062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202838062">(Jul 03 2020 at 21:32)</a>:</h4>
<p>did you also cross-compile a std?</p>



<a name="202838075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202838075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202838075">(Jul 03 2020 at 21:32)</a>:</h4>
<p>oh hmm, I see libstd</p>



<a name="202838080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202838080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202838080">(Jul 03 2020 at 21:33)</a>:</h4>
<p>why can't it find a crate for std</p>



<a name="202839011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839011">(Jul 03 2020 at 21:57)</a>:</h4>
<p>If you have cargo try <code>cargo -Zbuild-std --target ...</code>. You may need to symlink the rust source to the right place in the sysroot though. (you can install the rust-src rustup component on a system with working rustc to find the right place)</p>



<a name="202839080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839080">(Jul 03 2020 at 21:58)</a>:</h4>
<p>I think rustc thinks the target libstd is build with and the provided target are different. (does rustc take the target json path into account?)</p>



<a name="202839110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839110">(Jul 03 2020 at 21:59)</a>:</h4>
<p>Yep, was gonna suggest trying to rebuild a clean std</p>



<a name="202839116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839116">(Jul 03 2020 at 21:59)</a>:</h4>
<p><span class="user-mention" data-user-id="317220">@André Arko</span> ^</p>



<a name="202839267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839267">(Jul 03 2020 at 22:03)</a>:</h4>
<p>You could also try moving the directory in your stage1 to match that hash that showed up.</p>



<a name="202839318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839318">(Jul 03 2020 at 22:04)</a>:</h4>
<p><code>aarch64-apple-darwin-5608017271818730525</code></p>



<a name="202839330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839330">(Jul 03 2020 at 22:04)</a>:</h4>
<p>I think it should be the target spec that needs to be moved, not the sysroot dir.</p>



<a name="202839391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839391">(Jul 03 2020 at 22:06)</a>:</h4>
<p>Moving the sysroot dir may also be necessary though.</p>



<a name="202839427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839427">(Jul 03 2020 at 22:07)</a>:</h4>
<p>Finally you could set <code>RUSTC_LOG=trace</code> to show where the locator searches for which crate and what it found.</p>



<a name="202839872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202839872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202839872">(Jul 03 2020 at 22:17)</a>:</h4>
<p>I can’t figure what would cause that hash though</p>



<a name="202840117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202840117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202840117">(Jul 03 2020 at 22:23)</a>:</h4>
<p>hmm, RUSTC_LOG doesn't seem to be helping much</p>



<a name="202840120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202840120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202840120">(Jul 03 2020 at 22:23)</a>:</h4>
<div class="codehilite"><pre><span></span><code>❯ RUSTC_LOG=trace bin/rustc ../hello.rs --target /tmp/aarch64-apple-darwin.json
&#39;aarch64&#39; is not a recognized processor for this target (ignoring processor)
&#39;+cyclone&#39; is not a recognized feature for this target (ignoring feature)
&#39;aarch64&#39; is not a recognized processor for this target (ignoring processor)
[INFO  rustc_metadata::creader] resolving crate `std`
[INFO  rustc_metadata::creader] falling back to a load
error[E0463]: can&#39;t find crate for `std`
  |
  = note: the `aarch64-apple-darwin-5608017271818730525` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
</code></pre></div>



<a name="202840130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202840130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202840130">(Jul 03 2020 at 22:23)</a>:</h4>
<p>(I did move the directory to match the target in the error)</p>



<a name="202840273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202840273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202840273">(Jul 03 2020 at 22:26)</a>:</h4>
<p>Wonder if there’s a way to say “this stdlib, right here”</p>



<a name="202840676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202840676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202840676">(Jul 03 2020 at 22:37)</a>:</h4>
<p>Does <code>—verbose</code> (potentially repeated) do anything useful?</p>



<a name="202841252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202841252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202841252">(Jul 03 2020 at 22:52)</a>:</h4>
<p>lol it gets mad if you give verbose more than once</p>



<a name="202841254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202841254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202841254">(Jul 03 2020 at 22:52)</a>:</h4>
<p>but otherwise no</p>



<a name="202841255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202841255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202841255">(Jul 03 2020 at 22:52)</a>:</h4>
<p>same two INFO lines</p>



<a name="202847900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202847900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202847900">(Jul 04 2020 at 00:18)</a>:</h4>
<p>currently trying out:<br>
nightly x86 -&gt; stage1 (w/aarch64 target) x86 -&gt; stage1 (w/target+libc) arm64 -&gt; copy to DTK -&gt; x.py build</p>



<a name="202848605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202848605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202848605">(Jul 04 2020 at 00:40)</a>:</h4>
<p>Yes, that sounds like a good path. I'm going the same path, cleaning up my wild commits. We can compare to see how the results differ.</p>



<a name="202848616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202848616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202848616">(Jul 04 2020 at 00:41)</a>:</h4>
<p>although I think after copy to DTK you can try <code>rustc hello.rs</code> again</p>



<a name="202849424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202849424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202849424">(Jul 04 2020 at 01:08)</a>:</h4>
<p>I was just thinking that :)</p>



<a name="202849568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202849568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202849568">(Jul 04 2020 at 01:12)</a>:</h4>
<p>actually managed to get a rustc panic while trying to build the x86 stage1 inside the silicon branch, which was... odd. I just finished building that rustc with aarch64 built in from my branch with the target</p>



<a name="202849574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202849574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202849574">(Jul 04 2020 at 01:12)</a>:</h4>
<p>and now trying to build inside the silicon branch is getting me new errors <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="202849578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202849578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202849578">(Jul 04 2020 at 01:12)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0093]: unrecognized intrinsic function: `coverage_unreachable`
    --&gt; src/libcore/intrinsics.rs:1994:5
     |
1994 |     pub fn coverage_unreachable(start_byte_pos: u32, end_byte_pos: u32);
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unrecognized intrinsic
</code></pre></div>



<a name="202849970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202849970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202849970">(Jul 04 2020 at 01:23)</a>:</h4>
<p>wow I think I just had the silicon branch patches on an old commit <span aria-label="sob" class="emoji emoji-1f62d" role="img" title="sob">:sob:</span></p>



<a name="202850015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850015">(Jul 04 2020 at 01:24)</a>:</h4>
<p>hmm guess that wasn't it either, though</p>



<a name="202850377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850377">(Jul 04 2020 at 01:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> can you point me at the specific stuff from libc that is needed for the arm64 build? I'm getting a hard error when I try to use it:</p>



<a name="202850379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850379">(Jul 04 2020 at 01:36)</a>:</h4>
<div class="codehilite"><pre><span></span><code>Compiling libc v0.2.71 (/Users/andre/src/indirect/rust/silicon/libc)
error: the feature `cfg_target_vendor` has been stable since 1.33.0 and no longer requires an attribute to enable
  --&gt; silicon/libc/src/lib.rs:22:13
   |
22 |     feature(cfg_target_vendor, link_cfg, no_core)
   |             ^^^^^^^^^^^^^^^^^
   |
   = note: `-D stable-features` implied by `-D warnings`
</code></pre></div>



<a name="202850386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850386">(Jul 04 2020 at 01:37)</a>:</h4>
<p>That's a warning that pops up because we are using a <code>patch</code></p>



<a name="202850391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850391">(Jul 04 2020 at 01:37)</a>:</h4>
<p>In the <code>build-command</code> file, theres something like <code>--warnings warn</code></p>



<a name="202850393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850393">(Jul 04 2020 at 01:37)</a>:</h4>
<p>which downgrades that back to a warning instead of an error</p>



<a name="202850396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850396">(Jul 04 2020 at 01:38)</a>:</h4>
<p>ohhhh and I ran without it</p>



<a name="202850397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850397">(Jul 04 2020 at 01:38)</a>:</h4>
<p>got it</p>



<a name="202850434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850434">(Jul 04 2020 at 01:38)</a>:</h4>
<p>thank you <span aria-label="pray" class="emoji emoji-1f64f" role="img" title="pray">:pray:</span></p>



<a name="202850445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850445">(Jul 04 2020 at 01:39)</a>:</h4>
<p>when I do use your build command, in the silicon branch, with my stage1 that knows about the target, I get a bunch of errors like the one I pasted above (E0093), as well as a bunch like this:</p>



<a name="202850447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850447">(Jul 04 2020 at 01:39)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0658]: the `#[track_caller]` attribute is an experimental feature
    --&gt; src/libcore/str/mod.rs:1807:5
     |
1807 |     #[track_caller]
     |     ^^^^^^^^^^^^^^^
     |
     = note: see issue #47809 &lt;https://github.com/rust-lang/rust/issues/47809&gt; for more information
     = help: add `#![feature(track_caller)]` to the crate attributes to enable
</code></pre></div>



<a name="202850451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850451">(Jul 04 2020 at 01:39)</a>:</h4>
<p>I know how to handle that outside of rustc, with a crate attribute, can I just... turn that on in the Cargo.toml??</p>



<a name="202850512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850512">(Jul 04 2020 at 01:41)</a>:</h4>
<p>That one I haven't seen yet.</p>



<a name="202850520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850520">(Jul 04 2020 at 01:41)</a>:</h4>
<p>haha amazing, ok</p>



<a name="202850559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850559">(Jul 04 2020 at 01:42)</a>:</h4>
<p>I wonder if there's something about that stabilizing recently</p>



<a name="202850567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850567">(Jul 04 2020 at 01:43)</a>:</h4>
<p>but normally you'd add the <code>#![feature...]</code> even inside of the compiler</p>



<a name="202850568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850568">(Jul 04 2020 at 01:43)</a>:</h4>
<p>now I'm thinking I caused that by building a stage1 that isn't quite perfectly synced with the silicon branch base</p>



<a name="202850571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850571">(Jul 04 2020 at 01:43)</a>:</h4>
<p>yeah, like maybe your bootstrapping is slightly older</p>



<a name="202850572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850572">(Jul 04 2020 at 01:43)</a>:</h4>
<p>yeah</p>



<a name="202850731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850731">(Jul 04 2020 at 01:49)</a>:</h4>
<p>fyi the <code>--warnings warn</code> is the right flag to fix it! but it never got checked in to your build-command file <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="202850827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202850827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202850827">(Jul 04 2020 at 01:52)</a>:</h4>
<p>well thats a shame :-(</p>



<a name="202853913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202853913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202853913">(Jul 04 2020 at 03:29)</a>:</h4>
<p>okay, I must still be doing something wrong (maybe with my attempt to port the target from json into code?) because I'm failing on std:</p>



<a name="202853916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202853916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202853916">(Jul 04 2020 at 03:29)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: linking with `cc` failed: exit code: 1
  |
  = note: &quot;cc&quot; &quot;-L&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-sysroot/lib/rustlib/aarch64-apple-darwin/lib&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.0.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.1.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.10.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.11.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.12.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.13.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.14.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.15.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.2.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.3.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.4.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.5.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.6.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.7.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.8.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.9.rcgu.o&quot; &quot;-o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/libstd-5d89721d2a633549.dylib&quot; &quot;-Wl,-exported_symbols_list,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/list&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.25b81v2y56dbw6xv.rcgu.o&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.1clqmn3ehpucu4lf.rcgu.o&quot; &quot;-Wl,-dead_strip&quot; &quot;-dynamiclib&quot; &quot;-Wl,-dylib&quot; &quot;-Wl,-install_name&quot; &quot;-Wl,@rpath/libstd-5d89721d2a633549.dylib&quot; &quot;-nodefaultlibs&quot; &quot;-L&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps&quot; &quot;-L&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/release/deps&quot; &quot;-L&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/build/compiler_builtins-5c314fd0e9f2dea8/out&quot; &quot;-L&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/build/backtrace-sys-ba598233e523bfe5/out&quot; &quot;-L&quot; &quot;/Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-sysroot/lib/rustlib/aarch64-apple-darwin/lib&quot; &quot;-lSystem&quot; &quot;-lresolv&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libpanic_unwind-8061bc4ada431951.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libhashbrown-8df27caa4c250a4a.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/librustc_std_workspace_alloc-86e8af54f8bfb7c0.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libbacktrace-0f52fcf64d632e5d.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libbacktrace_sys-125eb7f4b7cd873a.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/librustc_demangle-7921f2e1e19891c0.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libunwind-83b17b29e4f09259.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libcfg_if-5c885cdd09427b28.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/liblibc-46611e71270459c5.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/liballoc-94eee920872943f0.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/librustc_std_workspace_core-05525fdda6f4fb91.rlib&quot; &quot;-Wl,-force_load&quot; &quot;-Wl,/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libcore-9725f80666c9d235.rlib&quot; &quot;/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/rustcaHMdZo/libcompiler_builtins-3050663811d8956c.rlib&quot; &quot;-lc&quot; &quot;-lm&quot; &quot;-Wl,-rpath,@loader_path/../lib&quot;
  = note: ld: warning: ld: warning: ignoring file /Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.1.rcgu.o, building for macOS-x86_64 but attempting to link with file built for macOS-arm64ignoring file /Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.0.rcgu.o, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

          ld: warning: ignoring file /Users/andre/src/indirect/rust/silicon/build/x86_64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps/std-5d89721d2a633549.std.6ot92z69-cgu.10.rcgu.o, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
</code></pre></div>



<a name="202853965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202853965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202853965">(Jul 04 2020 at 03:30)</a>:</h4>
<p>when I run the command <code>CFLAGS_aarch64_apple_darwin='-arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -Wl,-syslibroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk ' RUST_BACKTRACE=1 ../x.py build --stage 1 --host aarch64-apple-darwin src/libstd --jobs 1 -vvvvv --warnings warn</code> inside the silicon branch inside the silicon directory</p>



<a name="202853977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202853977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202853977">(Jul 04 2020 at 03:31)</a>:</h4>
<p>(I'm setting <code>rustc=&lt;my stage1 x86_64 rustc with both aarch64 target and the custom libc&gt;</code> in the config.toml before I run the command)</p>



<a name="202854256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202854256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202854256">(Jul 04 2020 at 03:40)</a>:</h4>
<p>hmm, I tried removing <code>--host</code> from the build command, but adding <code>host = ["aarch64-apple-darwin"]</code> and I've at least made it to building llvm</p>



<a name="202854259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202854259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> André Arko <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202854259">(Jul 04 2020 at 03:40)</a>:</h4>
<p>if nothing else, this is the farthest I've gotten so far, so hooray</p>



<a name="202884479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202884479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202884479">(Jul 04 2020 at 17:54)</a>:</h4>
<p>This is what I have for my current baked-in target spec:</p>
<div class="codehilite"><pre><span></span><code>MACOSX_DEPLOYMENT_TARGET=11.5 ./build/x86_64-apple-darwin/stage1/bin/rustc -Z unstable-options --target aarch64-apple-darwin --print target-spec-json
</code></pre></div>


<div class="codehilite"><pre><span></span><code><span class="p">{</span>
  <span class="nt">&quot;abi-return-struct-as-int&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;aarch64&quot;</span><span class="p">,</span>
  <span class="nt">&quot;archive-format&quot;</span><span class="p">:</span> <span class="s2">&quot;darwin&quot;</span><span class="p">,</span>
  <span class="nt">&quot;cpu&quot;</span><span class="p">:</span> <span class="s2">&quot;apple-a12&quot;</span><span class="p">,</span>
  <span class="nt">&quot;data-layout&quot;</span><span class="p">:</span> <span class="s2">&quot;e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128&quot;</span><span class="p">,</span>
  <span class="nt">&quot;dll-suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;.dylib&quot;</span><span class="p">,</span>
  <span class="nt">&quot;dynamic-linking&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;eliminate-frame-pointer&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  <span class="nt">&quot;emit-debug-gdb-scripts&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  <span class="nt">&quot;env&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  <span class="nt">&quot;executables&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;function-sections&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  <span class="nt">&quot;has-elf-tls&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;has-rpath&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;is-builtin&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;is-like-osx&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;link-env&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="s2">&quot;ZERO_AR_DATE=1&quot;</span>
  <span class="p">],</span>
  <span class="nt">&quot;link-env-remove&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="s2">&quot;IPHONEOS_DEPLOYMENT_TARGET&quot;</span>
  <span class="p">],</span>
  <span class="nt">&quot;linker-flavor&quot;</span><span class="p">:</span> <span class="s2">&quot;gcc&quot;</span><span class="p">,</span>
  <span class="nt">&quot;llvm-target&quot;</span><span class="p">:</span> <span class="s2">&quot;aarch64-apple-macosx11.5.0&quot;</span><span class="p">,</span>
  <span class="nt">&quot;max-atomic-width&quot;</span><span class="p">:</span> <span class="mi">128</span><span class="p">,</span>
  <span class="nt">&quot;os&quot;</span><span class="p">:</span> <span class="s2">&quot;macos&quot;</span><span class="p">,</span>
  <span class="nt">&quot;pre-link-args&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="nt">&quot;gcc&quot;</span><span class="p">:</span> <span class="p">[</span>
      <span class="s2">&quot;-arch&quot;</span><span class="p">,</span>
      <span class="s2">&quot;arm64&quot;</span>
    <span class="p">]</span>
  <span class="p">},</span>
  <span class="nt">&quot;stack-probes&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="nt">&quot;target-c-int-width&quot;</span><span class="p">:</span> <span class="s2">&quot;32&quot;</span><span class="p">,</span>
  <span class="nt">&quot;target-endian&quot;</span><span class="p">:</span> <span class="s2">&quot;little&quot;</span><span class="p">,</span>
  <span class="nt">&quot;target-family&quot;</span><span class="p">:</span> <span class="s2">&quot;unix&quot;</span><span class="p">,</span>
  <span class="nt">&quot;target-mcount&quot;</span><span class="p">:</span> <span class="s2">&quot;\u0001mcount&quot;</span><span class="p">,</span>
  <span class="nt">&quot;target-pointer-width&quot;</span><span class="p">:</span> <span class="s2">&quot;64&quot;</span><span class="p">,</span>
  <span class="nt">&quot;vendor&quot;</span><span class="p">:</span> <span class="s2">&quot;apple&quot;</span>
<span class="p">}</span>
</code></pre></div>



<a name="202884508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202884508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202884508">(Jul 04 2020 at 17:55)</a>:</h4>
<p>Specifically to note: <code>"cpu": "apple-a12",</code> — this reduces those warnings from LLVM about the wrong processor <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="202884551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202884551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202884551">(Jul 04 2020 at 17:56)</a>:</h4>
<p>gathered via <code>./build/x86_64-apple-darwin/llvm/bin/llc --mcpu=help --mtriple=aarch64-apple-darwin</code></p>



<a name="202884595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202884595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202884595">(Jul 04 2020 at 17:57)</a>:</h4>
<p>Hopefully close enough to A12Z</p>



<a name="202891921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202891921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202891921">(Jul 04 2020 at 21:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> The A12Z is just the A12 with a better GPU.</p>



<a name="202892054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202892054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202892054">(Jul 04 2020 at 21:28)</a>:</h4>
<p>Sounds good. <span aria-label="ok" class="emoji emoji-1f44c" role="img" title="ok">:ok:</span></p>



<a name="202897986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202897986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202897986">(Jul 05 2020 at 00:42)</a>:</h4>
<p><a href="/user_uploads/4715/xEA8EhP0rTmDjD5BI8VflVOR/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/xEA8EhP0rTmDjD5BI8VflVOR/image.png" title="image.png"><img src="/user_uploads/4715/xEA8EhP0rTmDjD5BI8VflVOR/image.png"></a></div><p>Progress continues apace.</p>



<a name="202919691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202919691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202919691">(Jul 05 2020 at 12:25)</a>:</h4>
<p><span class="user-mention" data-user-id="317220">@André Arko</span> <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span> I never pushed my changes to the libc branch, just made it. That's not useful</p>



<a name="202924412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/macOS%20cross-compile%20from%20x86_64/near/202924412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/macOS.20cross-compile.20from.20x86_64.html#202924412">(Jul 05 2020 at 14:45)</a>:</h4>
<p>And <span class="user-mention" data-user-id="119009">@eddyb</span> and <span class="user-mention" data-user-id="116122">@simulacrum</span> both helped me get a better build process, so I'm going to clean that up and update the README</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>